import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
export class list extends Component {
  render() {
      const {list,i}=this.props
    return (
      <div>
           <ul className='cont'>
        { list.length  ?list[i].child.map((item,index)=>{
             return <li key={index} onClick={
               ()=>{
                  this.props.history.push("/details/"+item.id)
               }
              
              

               }
              > <span> <img src={item.img} /> </span> <p>{item.wen}</p> </li>
           }) :'暂无数据'

           }
         
        </ul>

      </div>
    )
  }
}

export default withRouter (list) 